<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>学院-博客园</title>
    <link rel="stylesheet" href="./xlr-css/reset.css">
    <link rel="stylesheet" href="./xlr-css/dynamic.css">
</head>

<body>
    <!-- 头部导航 -->
    <div class="nav-top">
        <ul>
            <li><img src="./xlr-img/logo.png" alt=""></li>
            <li><a href="/">首页</a></li>
            <li><a href="/going">学习计划</a></li>
            <li><a href="/class">班级</a></li>
            <li><a href="javascprit:;" class="first">学习动态</a></li>
        </ul>

        <div class="container">
            <div class="title-card">最 近 动 态</div>
        </div>

    </div>



    <table>
        <tbody>

        </tbody>
    </table>

    <script src="./lib/jquery/jquery.min.js"></script>
    <script src="./lib/template/template.js"></script>
    <!-- 添加内容的模板 -->
    <script type="text/template" id="temp1">
        {{each list}}
        <div class="insert">
            <span class="td1">{{ $value.study_time }} 创建了任务</span>
            <span class="td2"><img src="./xlr-img/yuan.png" alt="">{{ $value.study_content }}</span>
        <div class="insert-img">
                <img src="./xlr-img/xlr.png" alt="">
            </div>

    </div>
    {{/each}}
    </script>
</body>

<script>
    // 渲染模板
    let show1 = () => {
        $.ajax({
            type: 'get',
            url: '/showUser1',
            data: '',
            success: function (result) {
                console.log(result)
                let str = template('temp1', {
                    list: result
                })
                $('tbody').html(str)
            }
        })
    }
    show1();
</script>

</html>